// $codepro.audit.disable com.instantiations.assist.eclipse.analysis.audit.rule.effectivejava.alwaysOverridetoString.alwaysOverrideToString
/**
 * Set-up users
 */
package edu.gatech.utilities;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import edu.gatech.datastorage.Gender;
import edu.gatech.datastorage.PatientInformation;
import edu.gatech.userclasses.Doctor;
import edu.gatech.userclasses.Nurse;
import edu.gatech.userclasses.Patient;
import edu.gatech.userclasses.SysAdmin;
import edu.gatech.userclasses.User;

/**
 * Initializes an array with some nonsense users for testing purposes
 * @author The 512's
 * @version 1.0
 */
public class SetUpUsers {

	/**
	 * Creates some users, adds them to an list, and sets the USERLIST in Persistence
	 * to the list created here
	 * @param args
	 */
	public static void main(String[] args){
//		Persistence.load();
		final Collection<User> list = new ArrayList<User>();
		final Nurse betty = new Nurse("nurse", "candycane");
		final List<String> medList = new ArrayList<String>();
		medList.add("Allegra");
		medList.add("Advil");
		final List<String> allergies = new ArrayList<String>();
		allergies.add("food");
		allergies.add("grass");
		allergies.add("water");
		final PatientInformation info = new PatientInformation
		("Frank", "passwd123", 23, Gender.MALE,  // $codepro.audit.disable numericLiterals
				"555-5555", "123 Main street", "CVS", "Geico", medList,
				allergies, "12/14/2000");
		final Patient frank = new Patient(info);
		final Doctor zhivago = new Doctor("Doctor", "lara");
		final SysAdmin linus = new SysAdmin("Admin", "penguin");
		final PatientInformation info2 = new PatientInformation("John", "passwd123",
				23, Gender.MALE,  // $codepro.audit.disable numericLiterals
				"555-5555", "123 Main street", "CVS", "Geico", medList,
				allergies, "12/14/2000");
		final Patient john = new Patient(info2);
		final Doctor doc = new Doctor("Bugs", "whatsup");
		final Nurse nurse = new Nurse("delete", "nurse");
		list.add(john);
		list.add(doc);
		list.add(nurse);
		list.add(betty);
		list.add(frank);
		list.add(zhivago);
		list.add(linus);
		Persistence.setUserList(list);
		Persistence.save();
	}
}
